package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.Token;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface TokenDao {

    @Insert("insert into token(tokenId,privateKey,expirationTime,customerId) " +
            "values(#{tokenId},#{privateKey},#{expirationTime},#{customerId})")
    int insert(Token token);

    @Delete("delete from token where customerId=#{id}")
    int delete(String id);
    @Select("select * from token where customerId=#{customerId}")
    Token query(String customerId);

    @Select("select * from token where tokenId=#{tokenId}")
    Token queryByTokenId(String tokenId);
}
